Slightly simplified version of adding KeyToValue for onnx export - #4881
Slightly simplified version of adding KeyToValue for onnx export#4881harishsk wants to merge 1 commit into
Conversation
|
I think the only difference between this and my fix is that in here all of the non-hidden columns at the output schema, which are KeyDataViewTypes, will be mapped back to values. In my other PR this doesn't happen for all columns, only for PredictedLabel and for columns that had the same name and where KeyDataViewTypes both in the input and output. A scenario were my PR and this PR would be different, is one where the user actually wants to apply a |
|
If ToKey applied on string and its output is among output columns of pipeline then Nimbus in python gives back categorical type, which is a tuple (string Value, int/uint Key). In ONNX we dont have categoricals so we can output either Value or a Key. Value is useful for presentation layer, like doing print etc. If there is a downstream learner that consumes ToKey output or we to stitch 2 ONNX models then its done off Key, while Value is ignored. I would sacrifice presentational purposes for functional ones, and would return Key instead of Value in ONNX models. PredictedLabel is the only exception as its usually final output and (ignoring stacking) used for presentation purposes only. |
|
This PR is superseded by #4841 . Closing. |
This is a variation of @antoniovs1029 's fix. This adds KeyToValueMappingTransformer in only one place. The results are identical between the two.